package com.kt.emall.order.web;

import com.kt.emall.order.service.OrderService;
import com.kt.emall.order.vo.OrderConfirmVO;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.GetMapping;

import javax.servlet.http.HttpServletRequest;

/**
 * @program: e-mall
 * @description: 订单页面控制器
 * @author: KamTang
 * @create: 2022-02-10 08:57
 **/
@Controller
public class OrderWebController {

    @Autowired
    OrderService orderService;

    @GetMapping("/toTrade")
    public String toTrade(Model model, HttpServletRequest request) {
        OrderConfirmVO confirmVO = orderService.confirmOrder();
        model.addAttribute("orderConfirmData", confirmVO);
        // 展示订单确认的数据
        return "confirm";
    }
}
